<?php
require_once $_site->get_viewpath("mobile/common/authcheck");
require_once $_site->get_viewpath("mobile/common/header");

//查询管理员信息
$admin_objet=new manager();
$cols='id,account,name,`group`,email,master,sex';
$admin_info=$admin_objet->admin_info($cols);
$pid=$admin_info['master']?$admin_info['master']:$admin_id;

$page=request('page',false,true,false,1);
$cond['pid']=$pid;
$cond['proid']=$proid=request('pid',false,true,false,0);
$device_list=$admin_objet->device_search($cond,$page);
$device_rtn=$admin_objet->device_rtn($device_list['rows']);
$project_rtn=$admin_objet->project_search($pid,2);
?>	
</head>

	<body>
		<div class="headertwo clearfloat" id="header">
			<a href="javascript:history.go(-1)" class="fl box-s"><i class="iconfont icon-arrow-l fl"></i></a>
			<p class="fl bt">设备信息</p>
            <a href="/mobile/center" class="fr"><i class="iconfont icon-gerenzhongxin fl"></i></a>			
		</div>
		
		<div class="clearfloat" id="main">
                <div class="rent  clearfloat">
		    			 	
		 	    <?php 
		 	       if($device_list['rows']){
		 	    ?>
                <ul class="find">
                <?php					
						foreach ($device_list['rows'] as $vo){
				?>
		       	  <li>		       	  			       	  
			       	  	<div class="find-left">			       	  	
			       	  		<!-- <p class="name">联系人:<?php echo $vo['linkman']?></p> -->
			       	  		<p class="style">车型：<?php echo $vo['cartype']?>&nbsp;&nbsp;车牌号:<?php echo $vo['car_number']?></p>			       	  		
			       	  		<p class="car">产权人：<?php echo $vo['doper']?></p>
			       	  		<p class="car">设备编号：<?php echo $device_rtn[$vo['did']]?></p>
			       	  		<p class="car">所属项目：<?php echo $project_rtn[$vo['pid']]?></p>
			       	  	</div>
			       	  	<div class="find-right" style="display: none">
			       	  		<p><span class="city"><?php echo $vo['phone'];?></span></p>
			       	  		<a href="tel:<?php echo $vo['phone'];?>" class="tele"><i class="mui-icon mui-icon-phone"></i></a>
			       	  	</div>		       	  	
		       	  </li>
		       	  <?php
		               }
		       	  ?>       	  
               </ul>
               <?php 
                  }else{
               ?>
                              
				<div class="empty-list clearfloat" id="main">
					<i class="iconfont icon-meineirong"></i>
					<p>没有找到相应设备！</p>
				</div>
				
				<?php } ?>
               					    					
			</div>
			
			<?php 
			   if($device_list['page_count']>1){
			?>	
			<div class="mui-content-padded">
				<ul class="mui-pager">
					<li class="mui-previous">	
					    <?php 
					       if($page<=1){
					    ?>				
						<a href="javascript:;">上一页</a>
						<?php
                           }else{
						?>
						<a href="?pid=<?php echo $proid?>&page=<?php echo $page-1;?>">上一页</a>
						<?php } ?>
					</li>
					<li class="mui-disabled">
						<span> <?php echo $page.' / '.$device_list['page_count']; ?> </span>
					</li>					
					<li class="mui-next">
					    <?php 
					       if($page>=$device_list['page_count']){
					    ?>				
						<a href="javascript:;">下一页</a>
						<?php
                           }else{
						?>
						<a href="?pid=<?php echo $proid?>&page=<?php echo $page+1;?>">下一页</a>
						<?php } ?>
					</li>
				</ul>
			</div>	
			<?php } ?>			
			
		</div>

		
	</body>	

</html>